package com.ruoyi.api.kehu;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.JiajiaCharityActivities;
import com.ruoyi.system.service.IJiajiaCharityActivitiesService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * 公益活动信息Controller
 * 
 * @author ruoyi
 * @date 2025-03-06
 */
@RestController
@RequestMapping("/api/kehu/jiajiaCharityActivities")
public class ApiJiajiaCharityActivitiesController extends BaseController{
    @Autowired
    private IJiajiaCharityActivitiesService jiajiaCharityActivitiesService;

    /**
     * 查询公益活动信息列表
     */
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(JiajiaCharityActivities jiajiaCharityActivities){
        startPage();
        List<JiajiaCharityActivities> list = jiajiaCharityActivitiesService.selectApiJiajiaCharityActivitiesList(jiajiaCharityActivities);
        return getDataTable(list);
    }

    /**
     * 根据id查看公益活动信息
     */
    @GetMapping("/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        JiajiaCharityActivities jiajiaCharityActivities = jiajiaCharityActivitiesService.selectApiJiajiaCharityActivitiesById(id);
        return AjaxResult.success(jiajiaCharityActivities);
    }
}
